home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 114 / PC Guia 114.iso / Software / Produtividade / Apache 2.0.52 / apache_2.0.52-win32-x86-no_ssl.msi / Data.Cab / F277231_apr_signal.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-02-13  |  2.4 KB  |  98 lines

  1. /* Copyright 2000-2004 The Apache Software Foundation
  2.  *
  3.  * Licensed under the Apache License, Version 2.0 (the "License");
  4.  * you may not use this file except in compliance with the License.
  5.  * You may obtain a copy of the License at
  6.  *
  7.  *     http://www.apache.org/licenses/LICENSE-2.0
  8.  *
  9.  * Unless required by applicable law or agreed to in writing, software
  10.  * distributed under the License is distributed on an "AS IS" BASIS,
  11.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12.  * See the License for the specific language governing permissions and
  13.  * limitations under the License.
  14.  */
  15.  
  16. #ifndef APR_SIGNAL_H
  17. #define APR_SIGNAL_H
  18.  
  19. /**
  20.  * @file apr_signal.h 
  21.  * @brief APR Signal Handling
  22.  */
  23.  
  24. #include "apr.h"
  25. #include "apr_pools.h"
  26.  
  27. #if APR_HAVE_SIGNAL_H
  28. #include <signal.h>
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif /* __cplusplus */
  34.  
  35. /**
  36.  * @defgroup apr_signal Handling
  37.  * @ingroup APR 
  38.  * @{
  39.  */
  40.  
  41. #if APR_HAVE_SIGACTION || defined(DOXYGEN)
  42.  
  43. #if defined(DARWIN) && !defined(__cplusplus) && !defined(_ANSI_SOURCE)
  44. /* work around Darwin header file bugs
  45.  *   http://www.opensource.apple.com/bugs/X/BSD%20Kernel/2657228.html
  46.  */
  47. #undef SIG_DFL
  48. #undef SIG_IGN
  49. #undef SIG_ERR
  50. #define SIG_DFL (void (*)(int))0
  51. #define SIG_IGN (void (*)(int))1
  52. #define SIG_ERR (void (*)(int))-1
  53. #endif
  54.  
  55. /** Function prototype for signal handlers */
  56. typedef void apr_sigfunc_t(int);
  57.  
  58. /**
  59.  * Set the signal handler function for a given signal
  60.  * @param signo The signal (eg... SIGWINCH)
  61.  * @param func the function to get called
  62.  */
  63. APR_DECLARE(apr_sigfunc_t *) apr_signal(int signo, apr_sigfunc_t * func);
  64.  
  65. #if defined(SIG_IGN) && !defined(SIG_ERR)
  66. #define SIG_ERR ((apr_sigfunc_t *) -1)
  67. #endif
  68.  
  69. #else /* !APR_HAVE_SIGACTION */
  70. #define apr_signal(a, b) signal(a, b)
  71. #endif
  72.  
  73.  
  74. /**
  75.  * Get the description for a specific signal number
  76.  * @param signum The signal number
  77.  * @return The description of the signal
  78.  */
  79. APR_DECLARE(const char *) apr_signal_description_get(int signum);
  80.  
  81. /** @deprecated @see apr_signal_description_get */
  82. APR_DECLARE(const char *) apr_signal_get_description(int signum);
  83.  
  84. /**
  85.  * APR-private function for initializing the signal package
  86.  * @internal
  87.  * @param pglobal The internal, global pool
  88.  */
  89. void apr_signal_init(apr_pool_t *pglobal);
  90.  
  91. /** @} */
  92.  
  93. #ifdef __cplusplus
  94. }
  95. #endif /* __cplusplus */
  96.  
  97. #endif /* APR_SIGNAL_H */
  98.